package com.lmonkey.servlet.user;

import java.io.IOException;
import java.util.ArrayList;


import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.jasper.tagplugins.jstl.core.ForEach;

import com.lmonkey.entity.LMONKEY_USER;
import com.lmonkey.service.LMONKEY_USERDao;

/**
 * Servlet implementation class DoUserSelect
 */
@WebServlet("/userselect")
public class userSelect extends HttpServlet {
	

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		String id = request.getParameter("id");
		//System.out.println(id);
		//获取所有用户记录
		LMONKEY_USER list= LMONKEY_USERDao.selectUser(id);
		//String userName = list.get(0).getUSER_NAME();
		//System.out.println(userName);
		//放到请求对象域里
		
		request.getSession().setAttribute("name",list);
		response.sendRedirect("index.jsp");
		
		
		
		//request.getRequestDispatcher("index.jsp").forward(request, response);
		
		
	
	}

	
}
